home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / voxel101.zip / VOIXELVI.REX < prev    next >
OS/2 REXX Batch file  |  1994-02-06  |  1KB  |  70 lines

  1. /* Script For Viewing GPFax-Document from VoiXEL    */
  2.  
  3. options results
  4. parse arg file pad            /* Gets the AmigaDOS argument for the PW */
  5.  
  6. signal on halt
  7. signal on syntax
  8. signal on break_c
  9.  
  10. options failat 50
  11.  
  12. say "ARexx-script for viewing GPFax-Document from VoiXEL"
  13. say ""
  14.  
  15. if file = '' then do
  16.    say "No FAX-file supplied!"
  17.    say "Exiting.."
  18.    exit
  19. end
  20.  
  21.  
  22. ADDRESS COMMAND "VoiXEL:VoiXELWaitForPort -q REXX_GPFAX"
  23.  
  24. if rc>0 then
  25.     do
  26.         say "Starting GPFax."
  27.         ADDRESS COMMAND "run >nil: <nil: GPFax:GPFax -z -W -NP -Q"
  28.         ADDRESS COMMAND "VoiXEL:VoiXELWaitForPort REXX_GPFAX"
  29.         if rc>0 then
  30.             do
  31.                 say "Couldn't start GPFax."
  32.                 exit
  33.             end
  34.         say "Sending ""viewfax " file """ to GPFax."
  35.         ADDRESS rexx_gpfax viewfax file
  36.         say "Quit GPFax."
  37.         ADDRESS rexx_gpfax quitfax
  38.     end
  39. else
  40.     do
  41.         say "Sending ""viewfax " file """ to GPFax."
  42.         ADDRESS rexx_gpfax viewfax file
  43.     end
  44.  
  45. exit
  46.  
  47.  
  48.  
  49. error:
  50.     call Debug("Error" rc "at line" sigl)
  51.     return rc
  52.  
  53. break_c:
  54. halt:
  55.     call Debug("CTRL_C at line" sigl)
  56.     exit 20
  57.  
  58. syntax:
  59.     call Debug("Syntax error" rc "at line" sigl)
  60.     return rc
  61.  
  62.  
  63. Debug: procedure
  64.     parse arg info
  65.  
  66.     firstLine = sourceline(1)
  67.     parse var firstLine '/*' title '*/'
  68.     say title ':' info
  69.     return
  70.